package com.lxd.property.controller;

import java.util.List;

import org.apache.poi.hssf.record.UserSViewBegin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lxd.property.pojo.Shacconumber;
import com.lxd.property.service.ShaService;

@Controller
@RequestMapping("shacconumber")
public class ShaController {

	@Autowired
	private ShaService shaService;

	@RequestMapping(value = "addSCN", method = RequestMethod.POST)
	@ResponseBody
	public boolean addSCN(Shacconumber scn) {
		int i = shaService.addSCN(scn);
		return i == 1 ? true : false;

	}

	@RequestMapping(value = "findAllShaCNO", method = RequestMethod.POST)
	@ResponseBody
	public List<Shacconumber> findAllShaCNO() {
		List<Shacconumber> list = shaService.findAllShaCNO();
		return list;
	}

	@RequestMapping(value = "findSCNById", method = RequestMethod.POST)
	@ResponseBody
	public Shacconumber findSCNById(Integer id) {
		return shaService.findSCNById(id);
	}

	@RequestMapping(value = "updateSCN", method = RequestMethod.POST)
	@ResponseBody
	public boolean updateSCN(Shacconumber scn) {
		int i = shaService.updateSCN(scn);
		return i == 1 ? true : false;
	}

	@RequestMapping(value = "deleteSCN", method = RequestMethod.POST)
	@ResponseBody
	public boolean deleteSCN(Integer id) {
		int i = shaService.deleteSCN(id);
		return i == 1 ? true : false;
	}
}
